using System;
using System.Collections.Generic;
using System.Text;

namespace ClientTools.Library.Media
{
    public class Property
    {

        public Property() { }
        public Property(umbraco.cms.businesslogic.property.Property umbracoProperty) 
        {
            this.Id = umbracoProperty.Id;
            this.PropertyTypeAlias = umbracoProperty.PropertyType.Alias;
            if (umbracoProperty.Value == null || umbracoProperty.Value is System.DBNull)
            {
                this.Value = "";
            }
            else
            {
                this.Value = (string)umbracoProperty.Value;
            }
            this.PropertyTypeId = umbracoProperty.PropertyType.Id;
        }

        private int _id;

        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }
        private string _propertyTypeAlias;

        public string PropertyTypeAlias
        {
            get { return _propertyTypeAlias; }
            set { _propertyTypeAlias = value; }
        }
        private string _value;

        public string Value
        {
            get { return _value; }
            set { _value = value; }
        }
        private int _propertyTypeId;

        public int PropertyTypeId
        {
            get { return _propertyTypeId; }
            set { _propertyTypeId = value; }
        }
    }
}
